<?php

$abs_modpath    = dirname(__FILE__);
require($abs_modpath . '/global.php');
require($abs_modpath . '/admin_core.libs.php');



$arr_msg        = array();
$mod_url        = parse_mod_url();
$abs_modpath    = dirname(__FILE__);
$js_error       = 0;
$G_msg  = array(
    'jobs'  => array('u.add' => null, 'u.li' => null ),
    'redirect' => 'u.li'
    );

$arr_msg    = array(
    'redirect_url'  => $mod_url['core_li'],
    'redirect'      => get_oplist('c.li'),
    );

if(in_array($action, array('c.li', 'c.index', ''))) {
    // 添加/修改
    if($save == $save_flag) {
        if($sid = savecore()) {
            $arr_msg['msg']     = '保存核心参数成功！';
            $arr_msg['oplist']  = get_oplist($arr_jobs);
            redirect_msg($arr_msg, 0);
        } else {
            add_system_error();
        }
    } else {
        $record = readcore();
        $cur_view   = 'views/core_view.php';
    }
} else {
    add_system_error();
}

// 在载入视图之前，先查看错误集中是否有错误
check_error($arr_msg, $js_error);
// 载入视图
require($abs_modpath . '/' . $cur_view);
?>